import type { roleInfoType } from "./type.ts";
import { req } from "_s/boot/axios";
// export const userLogin = (data: loginType) => {
//   return req.request<ApiResponseData<string>>({
//     url: "/user/login",
//     method: "post",
//     data
//   });
// };

// export const userInfo = () => {
//   return req.request<ApiResponseData<userInfoType>>({
//     url: "/user/info",
//     method: "get"
//   });
// };

// export const changePassword = (data: changePasswordType) => {
//   return req.request<ApiResponseData<string>>({
//     url: "/user/changePassword",
//     data,
//     method: "post"
//   });
// };

export const getRoleList = (params: pagination) => {
  return req.request<ApiResponseData<page<roleInfoType[]>>>({
    url: "/role/list",
    params,
    method: "get"
  });
};

export const postRoleUpdateUser = (data: { id: roleInfoType["id"]; userIds: roleInfoType["userIds"] }) => {
  return req.request<ApiResponseData<string>>({
    url: "/role/updateUser",
    data,
    method: "post"
  });
};
